# 00.01.class" error?

**URL:** <https://www.ruby-forum.com/t/00-01-class-error/86703>\
**Category:** Ruby\
**Created:** [February 24, 2007, 8:33pm UTC](https://www.ruby-forum.com/t/00-01-class-error/86703 "2007-02-24T20:33:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubysharma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a5b964/32.png) [@rubysharma](https://www.ruby-forum.com/u/rubysharma)\
**Post date:** [February 24, 2007, 8:33pm UTC](https://www.ruby-forum.com/t/00-01-class-error/86703/1 "2007-02-24T20:33:16Z")

</div>

Hi,

0.1.class results in float.  
00.1.class results in error?

* * *

SyntaxError: compile error  
(irb):5: no . floating literal anymore; put 0 before dot  
00.1class  
^  
(irb):5: syntax error  
00.1class  
^  
from (irb):5

* * *

as humans ignore any number of zeros before. why did ruby compiler  
concerned abt it?. why this?. needs a fix to compiler 😛

sharma

---

<div class="post-metadata">

**Author:** ![rubysharma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a5b964/32.png) [@rubysharma](https://www.ruby-forum.com/u/rubysharma)\
**Post date:** [February 24, 2007, 9:58pm UTC](https://www.ruby-forum.com/t/00-01-class-error/86703/2 "2007-02-24T21:58:25Z")

</div>

On Feb 24, 2007, at 2:33 PM, Sharma C. wrote:

> 00.1class  
> ^  
> from (irb):5
> 
> * * *
> 
> as humans ignore any number of zeros before. why did ruby compiler  
> concerned abt it?. why this?. needs a fix to compiler 😛

I think the problem is that floating point literals must be written  
in base 10, unlike integer literals which can be written in octal.  
In your case:

00.1.class

the parser sees “00” as as 0 written as an octal constant. The parser  
doesn’t consider it as the start of a floating point value because  
floating point values must be written in decimal. So after parsing  
the “00” as an integer literal it sees “.1” as a no longer supported  
floating point literal and complains.

Gary W.
