Discrete Math Assignment

Viewed 17

Given the number types:

•N for all natural numbers

•Z for all integers

•Z+ for all positive integers

•Q for all rational number

•I for all irrational numbers

•R for all real numbers

•W for all whole numbers

•C for all complex numbers

.. and given the following numbers:

•pi (3.14...)

•1

•-5

•binary number 0b01111111

•octal number 0o754

•hexadecimal number 0x39

A. 80% – Write a basic program that simply prints “true” or “false” given each of the 6 numbers for each of the 8 number types above. Do this in SML and then in SQLite.

For example, your program will include the following output statements:

… in SML:

print “-5 is an element of N: true”;

print “0b01111111 is an element of N: true”;

0 Answers
Related