[PD] hexadecimal conversion problem

Alexandre Torres Porres porres at gmail.com
Wed Jan 20 03:58:08 CET 2021


sorry, now that I read your email, I see you know about the solution I
provide, and yeah, I now see the same issue.

But in my abstraction, if I convert "0x27E5" instead of "27E5", it works!
I'll have to see why this is happening...

Em ter., 19 de jan. de 2021 às 21:22, oliver <oliver at klingt.org> escreveu:

> hi,
>
> i'm trying to convert arbitrary hexadecimal numbers to decimal ones,
> preferably with vanilla objects.
>
> while it's easy to do it the other way round with [makefilename], i'm
> facing a peculiar problem from hex --> dec when the letter E is present
> and followed by a number.
>
> my approach would be to take a hex number, interpret it as a symbol, get
> each hex-digit's ascii value, and do the conversion from there
>
> let's take the hex number 27E5 as an example
>
> no matter what sort of conversion i try ([symbol], [list tosymbol],
> [makefilename], [fudiformat]), PD always interprets it as a decimal
> number with an exponent, so
>
> [27E5(
> |
> makefilename %s
> |
> [print]
>
> will give me "symbol 2.7e+006" in the console (or in a symbol atom).
>
> (of course a number like 27A5 or 275E expands with no problem to a
> straight symbol and can then be ascii-fied)
>
> is there anything i can do to make PD take 27E5 as a literal symbol
> rather than a float ?
>
> best
>
> oliver
>
> --
> \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
> /////////////// http://pendler.klingt.org //////////////
> \\\\\\\\\\\\\\\ http://oliver.klingt.org  \\\\\\\\\\\\\\
> ////////////////////////////////////////////////////////
>
>
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management ->
> https://lists.puredata.info/listinfo/pd-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20210119/7de077c0/attachment.html>


More information about the Pd-list mailing list