Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Is 0.0 float or integer

Name: Anonymous 2009-03-21 8:13

Name: Anonymous 2009-03-21 8:14

float

Name: Anonymous 2009-03-21 8:24

Two widely-staring eyes.

Name: Anonymous 2009-03-21 8:44

flint

Name: Anonymous 2009-03-21 8:48

IEEE double-precision integer

Name: Anonymous 2009-03-21 9:20

0 :: (Fractional t) => t

Name: Anonymous 2009-03-21 11:55

oat

Name: Anonymous 2009-03-21 11:57

doubtful this would even compile unless a 0 object has a 0 method.

Name: Anonymous 2009-03-21 16:47

fixnum

Name: Anonymous 2009-03-21 17:25

irb(main):001:0> 0.0.class
=> Float

Name: Anonymous 2009-03-21 17:38

Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 5.7.8)
Copyright (c) 1990-2009 University of Amsterdam.
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.

For help, use ?- help(Topic). or ?- apropos(Word).

?- float(0.0).
true.

?- integer(0.0).
false.


P# 1.1.3
Small Prolog Interpreter
| ?- float(0.0).

yes
| ?- integer(0.0).

no


GNU Prolog 1.3.0
By Daniel Diaz
Copyright (C) 1999-2007 Daniel Diaz
| ?- float(0.0).

yes
| ?- integer(0.0).

no

Name: Anonymous 2009-03-21 18:55

P#
GNU Prolog
lol toy prologs

Name: Anonymous 2009-03-21 18:58

So >>12-san, what is an example of a "real" prolog?

Name: Anonymous 2009-03-21 19:01

Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
print(type(0.0))
number

Name: Anonymous 2009-03-21 19:05

>>13
Microsoft Visual Studio 2008 Prolog.

Name: Anonymous 2009-03-21 19:11

>>13
SWI-Prolog

Name: Anonymous 2010-05-30 6:21

>>13
ANUS-Prolog

Name: Anonymous 2010-05-30 6:24


>>> type(0.0)
<type 'float'>
>>>

Name: Anonymous 2010-05-30 7:09

>>18
Ah, the C++ repl.

Name: Anonymous 2010-05-30 7:22

>>19
it's python

Name: Anonymous 2010-05-30 11:26

in c++ it's double. 0.0f is float.

Name: Anonymous 2010-05-30 11:57

>>21
Same for Java.

Name: Anonymous 2010-05-30 15:16

alert(typeof 0.0); // number

Name: Anonymous 2010-05-30 15:18


* (type-of 0.0)
SINGLE-FLOAT

Name: Anonymous 2010-05-30 15:42


 ruby -e 'puts (0.0).class'

Name: Anonymous 2010-05-30 15:43

oops forgot output

ruby -e 'puts (0.0).class'
Float

Name: Anonymous 2010-05-30 15:46

> (number? 0.0)
#t
(integer? 0.0)
#t
(exact? 0.0)
#f

All hail the might of abstraction safe languages!

Name: Anonymous 2010-05-31 1:40


% php -r 'echo gettype(0.0), "\n";'
double
%

Name: Anonymous 2010-05-31 2:00

Prelude> :t 0.0
0.0 :: (Fractional t) => t

Name: Anonymous 2010-05-31 2:04

>>29
You're too late¹.

------
¹: >>6

Name: Anonymous 2010-05-31 3:18

null

Name: Anonymous 2010-05-31 6:10

[code
EnterpriseFloatingPointNumberInstance
[/code]

Name: Anonymous 2010-05-31 6:11


EnterpriseFloatingPointNumberInstance

Name: Anonymous 2010-05-31 6:33

I want you to consider the following paradox:
Prelude> 1.0 == 0.99999999999999999
True

Name: Anonymous 2010-05-31 7:00

I want you to consider the following paradox:
Prelude> 10 == 0xA
True

Name: Anonymous 2010-05-31 8:29

>>35
THE UNIVERSE IS IN DANGER: PART ONE

Name: Anonymous 2010-05-31 10:24

>>> 010.5 - 010
2.5

Name: Anonymous 2010-05-31 10:29

>>37
>>> 010.5 - (010 + .5)
2.0

now that's some quality language design right there.

Name: Anonymous 2010-05-31 10:37

PY3000 fixes some of it:
>>> 010.5 - 010
  File "<stdin>", line 1
    010.5 - 010
              ^
SyntaxError: invalid token
>>> 010.5 - 0o10
2.5

Name: Anonymous 2010-05-31 10:38

>>38
You're saying octal shouldn't be recognised?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List