Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-06

Dec2Numb with negative numbers

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Roberto P.

Hi List,

I recently stumbled upon the fact that the Dec2Numb function does not work with negative numbers. Specifically, converting a negative longint returns an empty string.

Is that intended or is it a bug?
Maybe a base conversion routine should be somehow "aseptic" or anyway independent from the sign.

Roberto

Reply by email

Michael Van Canneyt
to Roberto P.
Roberto P. wrote 6 lines
Hi List, I recently stumbled upon the fact that the Dec2Numb function does not work with negative numbers. Specifically, converting a negative longint returns an empty string. Is that intended or is it a bug? Maybe a base conversion routine should be somehow "aseptic" or anyway independent from the sign.

It is intended, but not documented. I will document it. (the same is true for numb2dec)

Michael.

Reply by email

Roberto P.
to Michael Van Canneyt

Thanks!

Is there an unsigned alternative?

R.

2013/6/16 Michael Van Canneyt

Show quoted text 23 lines
On Fri, 14 Jun 2013, Roberto P. wrote: Hi List, > I recently stumbled upon the fact that the Dec2Numb function does not > work with negative numbers. Specifically, converting a negative longint > returns an empty > string. > > Is that intended or is it a bug? > Maybe a base conversion routine should be somehow "aseptic" or anyway > independent from the sign. > It is intended, but not documented. I will document it. (the same is true for numb2dec) Michael. ______________________________**_________________ fpc-pascal maillist - http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal>

Reply by email