C#和sqlserver数字数据类型学习
C#数字类型的数据包括decimal, double和 float。以前学过现在忘得都差不多了,现在简单的复习一下。 根据MSDN的解释, decimal类型是128位的浮点数,数据范围是1.010 28 to 7.910 28 ,精度在28-29位有效数字,在一个数字后面加m或M代表它是decimal类型。 do
C#数字类型的数据包括decimal, double和 float。以前学过现在忘得都差不多了,现在简单的复习一下。
根据MSDN的解释,
decimal类型是128位的浮点数,数据范围是±1.0 × 10−28 to ±7.9 × 1028,精度在28-29位有效数字,在一个数字后面加m或M代表它是decimal类型。
double类型是64位的浮点数,数据范围是±5.0 × 10−324 to ±1.7 × 10308,精度在15-16位有效数字,在一个数字后面加d或D代表它是double类型。正常的带小数点的数字都会默认为double类型,如果想让一个整形作为double类型处理,就在后面加上d或D. 相比之下,decimal类型比double类型精度高,但是范围相对小一些。
float类型是32位的浮点数,数据范围是±1.5 × 10−45 to ±3.4 × 1038,精度是7位,在一个数字后面加f或F代表它是float类型。可以看出,它比decimal类型精度小很多,但是范围要大一些。
对于sqlserver里的money类型,它8位的,数据范围在-922,337,203,685,477.5808 到922,337,203,685,477.5807之间得数据类型,
smallmoney则是4位的在- 214,748.3648 到214,748.3647之间。
在sqlserver中还有数字类型,就是decimal和numeric,它们是相同的,具有可以指定的精度(有效数字位数)和规格,最大范围是- 10^38 +1 到10^38 - 1。
下表表示了精度和存储位数的关系:
精度 | 存储位数 |
---|---|
1 - 9 |
5 |
10-19 |
9 |
20-28 |
13 |
29-38 |
17 |

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The import steps are as follows: Copy the MDF file to SQL Server's data directory (usually C:\Program Files\Microsoft SQL Server\MSSQL\DATA). In SQL Server Management Studio (SSMS), open the database and select Attach. Click the Add button and select the MDF file. Confirm the database name and click the OK button.

If you accidentally delete a SQL Server database, you can take the following steps to recover: stop database activity; back up log files; check database logs; recovery options: restore from backup; restore from transaction log; use DBCC CHECKDB; use third-party tools. Please back up your database regularly and enable transaction logging to prevent data loss.

Facing lag, slow mobile data connection on iPhone? Typically, the strength of cellular internet on your phone depends on several factors such as region, cellular network type, roaming type, etc. There are some things you can do to get a faster, more reliable cellular Internet connection. Fix 1 – Force Restart iPhone Sometimes, force restarting your device just resets a lot of things, including the cellular connection. Step 1 – Just press the volume up key once and release. Next, press the Volume Down key and release it again. Step 2 – The next part of the process is to hold the button on the right side. Let the iPhone finish restarting. Enable cellular data and check network speed. Check again Fix 2 – Change data mode While 5G offers better network speeds, it works better when the signal is weaker

If the SQL Server installation fails, you can clean it up by following these steps: Uninstall SQL Server Delete registry keys Delete files and folders Restart the computer

I cry to death. The world is madly building big models. The data on the Internet is not enough. It is not enough at all. The training model looks like "The Hunger Games", and AI researchers around the world are worrying about how to feed these data voracious eaters. This problem is particularly prominent in multi-modal tasks. At a time when nothing could be done, a start-up team from the Department of Renmin University of China used its own new model to become the first in China to make "model-generated data feed itself" a reality. Moreover, it is a two-pronged approach on the understanding side and the generation side. Both sides can generate high-quality, multi-modal new data and provide data feedback to the model itself. What is a model? Awaker 1.0, a large multi-modal model that just appeared on the Zhongguancun Forum. Who is the team? Sophon engine. Founded by Gao Yizhao, a doctoral student at Renmin University’s Hillhouse School of Artificial Intelligence.

The latest video of Tesla's robot Optimus is released, and it can already work in the factory. At normal speed, it sorts batteries (Tesla's 4680 batteries) like this: The official also released what it looks like at 20x speed - on a small "workstation", picking and picking and picking: This time it is released One of the highlights of the video is that Optimus completes this work in the factory, completely autonomously, without human intervention throughout the process. And from the perspective of Optimus, it can also pick up and place the crooked battery, focusing on automatic error correction: Regarding Optimus's hand, NVIDIA scientist Jim Fan gave a high evaluation: Optimus's hand is the world's five-fingered robot. One of the most dexterous. Its hands are not only tactile

The syntax differences between MySQL and SQL Server are mainly reflected in database objects, data types, SQL statements and other aspects. Database object differences include the storage engine and how filegroups are specified, and the creation of indexes and constraints. Data type differences involve differences in numeric types, character types, and date and time types. SQL statement differences are reflected in result set limitations, data insertion, update and delete operations, etc. Other differences include how identity columns, views, and stored procedures are created. Understanding these differences is important to avoid errors when using different database systems.

The problem that SQL Server cannot be reinstalled due to incomplete deletion can be solved by following the following steps: manually delete files and registry entries; use SQL Server installation and uninstall tools; use third-party uninstall tools; check Windows Event Viewer; restart the computer; reinstall SQL Server.
