octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #45945] Missing Matlab's special support for i


From: Rik
Subject: [Octave-bug-tracker] [bug #45945] Missing Matlab's special support for integer literals
Date: Fri, 23 Oct 2015 16:46:45 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0

Update of bug #45945 (project octave):

              Item Group:          WTF, Matlab?!? => Matlab Compatibility   

    _______________________________________________________

Follow-up Comment #4:

It will undoubtedly get messier in the actual implementation, but I can see at
least two ways to tackle this

1) Find the pattern (u)int64 in the lexer, possible using state code prefixed
to patterns, and convert the number that follows into (u)int64 rather than
double.  We don't need to worry about the other integer families like int32
because they can always be represented correctly by a double.

2) In the handle_number routine in lex.ll we can find the length of the string
representing the number to be converted.  If it is hex and greater then 13
characters, then convert to an int64.  If it is binary and greater than 53
characters, then convert to int64.  If it is decimal and greater than 16
characters (log10(2^53), convert to an int64.

Might work.  Might still require tweaking the parser as well if it is always
expecting an object of type double rather than an octave_value.  Could get
around that, possibly, by using a union type.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45945>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]