Sha256: 684f4b46077bdb3f7f7e2676bd396dee8280857c381250901f8b12be335f2fcf
Contents?: true
Size: 912 Bytes
Versions: 10
Compression:
Stored size: 912 Bytes
Contents
{{works with|SmartEiffel|2.4}} In a file called main.e: class MAIN creation make feature make is local a, b: REAL; do print("a = "); io.read_real; a := io.last_real; print("b = "); io.read_real; b := io.last_real; print("a + b = "); io.put_real(a + b); print("%Na - b = "); io.put_real(a - b); print("%Na * b = "); io.put_real(a * b); print("%Na / b = "); io.put_real(a / b); print("%Na %% b = "); io.put_real(((a / b) - (a / b).floor) * b); print("%Na ^ b = "); io.put_real(a.pow(b)); print("%N"); end end Note that there actually is a builtin modulo operator (\\). However, it seems impossible to use that instruction with SmartEiffel.
Version data entries
10 entries across 7 versions & 1 rubygems