Sha256: fc3bd1a7f3a8a61842f8936477c49684d2e1712f8b996d985df63a2470ea4142
Contents?: true
Size: 1.09 KB
Versions: 10
Compression:
Stored size: 1.09 KB
Contents
All numeric is 8-byte-float. Conversions are by INT, NINT, FLOOR, CEILING, or Formatted IO DLG(Edit=A, Edit=B, TItle='Enter numeric A and B') WRITE(Name) A, B WRITE() ' A + B = ', A + B WRITE() ' A - B = ', A - B WRITE() ' A * B = ', A * B WRITE() ' A / B = ', A / B ! no truncation WRITE() 'truncate A / B = ', INT(A / B) ! truncates towards 0 WRITE() 'round next A / B = ', NINT(A / B) ! truncates towards next integer WRITE() 'round down A / B = ', FLOOR(A / B) ! truncates towards minus infinity WRITE() 'round up A / B = ', CEILING(A / B) ! truncates towards plus infinity WRITE() 'remainder of A / B = ', MOD(A, B) ! same sign as A WRITE() 'A to the power of B = ', A ^ B WRITE() 'A to the power of B = ', A ** B A=5; B=-4; A + B = 1 A - B = 9 A * B = -20 A / B = -1.25 truncate A / B = -1 round next A / B = -1 round down A / B = -2 round up A / B = -1 remainder of A / B = 1 A to the power of B = 16E-4 A to the power of B = 16E-4
Version data entries
10 entries across 7 versions & 1 rubygems