September Morn Update

This commit is contained in:
Ingy döt Net 2019-09-12 10:33:56 -07:00
parent 4e2d22a71d
commit aac6731f2c
6856 changed files with 141342 additions and 21127 deletions

View file

@ -0,0 +1 @@
--- {}

View file

@ -1,4 +1,6 @@
' FB 1.05.0 Win64
#include <stdio.h>
<lang freebasic>' FB 1.05.0 Win64
' The suffixes L, LL, UL and ULL are added to the numbers to make it
' clear to the compiler that they are to be treated as:

View file

@ -0,0 +1,61 @@
println "\nSigned 32-bit (failed):"
assert -(-2147483647-1) != 2147483648g
println(-(-2147483647-1))
assert 2000000000 + 2000000000 != 4000000000g
println(2000000000 + 2000000000)
assert -2147483647 - 2147483647 != -4294967294g
println(-2147483647 - 2147483647)
assert 46341 * 46341 != 2147488281g
println(46341 * 46341)
//Groovy converts divisor and dividend of "/" to floating point. Use "intdiv" to remain integral
//assert (-2147483647-1) / -1 != 2147483648g
assert (-2147483647-1).intdiv(-1) != 2147483648g
println((-2147483647-1).intdiv(-1))
println "\nSigned 64-bit (passed):"
assert -(-2147483647L-1) == 2147483648g
println(-(-2147483647L-1))
assert 2000000000L + 2000000000L == 4000000000g
println(2000000000L + 2000000000L)
assert -2147483647L - 2147483647L == -4294967294g
println(-2147483647L - 2147483647L)
assert 46341L * 46341L == 2147488281g
println(46341L * 46341L)
assert (-2147483647L-1).intdiv(-1) == 2147483648g
println((-2147483647L-1).intdiv(-1))
println "\nSigned 64-bit (failed):"
assert -(-9223372036854775807L-1) != 9223372036854775808g
println(-(-9223372036854775807L-1))
assert 5000000000000000000L+5000000000000000000L != 10000000000000000000g
println(5000000000000000000L+5000000000000000000L)
assert -9223372036854775807L - 9223372036854775807L != -18446744073709551614g
println(-9223372036854775807L - 9223372036854775807L)
assert 3037000500L * 3037000500L != 9223372037000250000g
println(3037000500L * 3037000500L)
//Groovy converts divisor and dividend of "/" to floating point. Use "intdiv" to remain integral
//assert (-9223372036854775807L-1) / -1 != 9223372036854775808g
assert (-9223372036854775807L-1).intdiv(-1) != 9223372036854775808g
println((-9223372036854775807L-1).intdiv(-1))
println "\nSigned unbounded (passed):"
assert -(-2147483647g-1g) == 2147483648g
println(-(-2147483647g-1g))
assert 2000000000g + 2000000000g == 4000000000g
println(2000000000g + 2000000000g)
assert -2147483647g - 2147483647g == -4294967294g
println(-2147483647g - 2147483647g)
assert 46341g * 46341g == 2147488281g
println(46341g * 46341g)
assert (-2147483647g-1g).intdiv(-1) == 2147483648g
println((-2147483647g-1g).intdiv(-1))
assert -(-9223372036854775807g-1) == 9223372036854775808g
println(-(-9223372036854775807g-1))
assert 5000000000000000000g+5000000000000000000g == 10000000000000000000g
println(5000000000000000000g+5000000000000000000g)
assert -9223372036854775807g - 9223372036854775807g == -18446744073709551614g
println(-9223372036854775807g - 9223372036854775807g)
assert 3037000500g * 3037000500g == 9223372037000250000g
println(3037000500g * 3037000500g)
assert (-9223372036854775807g-1g).intdiv(-1) == 9223372036854775808g
println((-9223372036854775807g-1g).intdiv(-1))

View file

@ -1,4 +1,6 @@
put -(-2147483647-1)
#include <stdio.h>
<lang lingo>put -(-2147483647-1)
-- -2147483648
put 2000000000 + 2000000000

View file

@ -1,3 +1,6 @@
#include <stdio.h>
<lang perl>
use strict;
use warnings;
use integer;