MySQL 数据类型 MySQL中定义数据字段的类型对你数据库的优化是非常重要的。 MySQL支持多种类型,大致可以分为三类:数值、日期/时间和字符串(字符)类型。 数值类型 MySQL支持所有标准SQL数值数据类型。 这些类型包括严格数值数据类型(INTEGER、SMALLINT、DECIMAL和 ...
分类:
数据库 时间:
2020-02-29 13:16:44
阅读次数:
256
java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result. at java.math.BigDecimal.divide(Unknown Source ...
分类:
编程语言 时间:
2020-02-26 18:42:55
阅读次数:
72
1 local function keepTwoDecimalPlaces(decimal) 2 decimal = decimal * 100 3 if decimal % 1 >= 0.5 then 4 decimal=math.ceil(decimal) 5 else 6 decimal=ma ...
分类:
其他好文 时间:
2020-02-23 18:05:21
阅读次数:
88
A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a re ...
分类:
其他好文 时间:
2020-02-22 23:46:40
阅读次数:
64
在数字电路中,经常会遇到进制转换问题,如二进制 (Binary) 转 BCD (Binary Coded Decimal)。针对这种数制的转换,有个很神奇的算法—— double dabble algorithm ,也称为 shift and add 3 algorithm 。 其主要流程如下(摘自 ...
分类:
其他好文 时间:
2020-02-21 00:07:05
阅读次数:
84
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is , if 6 is a decimal number and 110 is a bi ...
分类:
其他好文 时间:
2020-02-20 12:54:51
阅读次数:
69
主要包括以下五大类:整数类型:BIT、BOOL、TINY INT、SMALL INT、MEDIUM INT、 INT、 BIG INT 浮点数类型:FLOAT、DOUBLE、DECIMAL 字符串类型:CHAR、VARCHAR、TINY TEXT、TEXT、MEDIUM TEXT、LONGTEXT、 ...
分类:
数据库 时间:
2020-02-17 12:07:33
阅读次数:
107
在SQL Server中,将字符串的值转换为数值类型的值可以有三种方法。 1.使用cast()方法。 select cast('6.0' as decimal(6, 2)); -- 6.00 2.使用convert()方法。 select convert(decimal(6, 2), '100'); ...
分类:
数据库 时间:
2020-02-15 10:09:08
阅读次数:
143
网上DS12C887的文章涉及到时间的存储格式使用的都是二进制代码,究竟使用BCD码该如何操作?正好美心官网上有一篇文章。美心官网不稳定,先贴到这里,有时间再翻译。 原文链接 State Machine Logic in Binary-Coded Decimal (BCD)-Formatted Re ...
分类:
其他好文 时间:
2020-02-14 16:50:01
阅读次数:
81
decimal模块 简介 decimal意思为十进制,这个模块提供了十进制浮点运算支持。 常用方法 1.可以传递给Decimal整型或者字符串参数,但不能是浮点数据,因为浮点数据本身就不准确。 2.要从浮点数据转换为Decimal类型 from decimal import * Decimal.fr ...
分类:
其他好文 时间:
2020-02-13 16:43:28
阅读次数:
73