mirror of
https://github.com/chaisql/chai.git
synced 2025-10-07 08:30:52 +08:00
Handle integer conversion errors (#425)
When converting a double larger or equal to math.MaxInt64 to an integer, it previously overflowed silently. It now returns an explicit error. This fixes along the way, the math.abs(-9223372036854775808) issue.
This commit is contained in:

committed by
GitHub

parent
daf4f79e9f
commit
01c87d1bf7
@@ -17,6 +17,8 @@ NULL
|
||||
2.0
|
||||
! math.abs('foo')
|
||||
'cannot cast "foo" as double'
|
||||
! math.abs(-9223372036854775808)
|
||||
'integer out of range'
|
||||
|
||||
-- test: math.acos
|
||||
> math.acos(NULL)
|
||||
|
Reference in New Issue
Block a user