| Author |
Message |
|
| Guest |
Posted: Mon Dec 17, 2007 6:13 pm |
|
|
|
Guest
|
Hi
In erlsql.erl:
encode(Val, false) when is_integer(Val) ->
integer_to_list(Val);
encode(Val, false) when is_float(Val) ->
[Res] = io_lib:format("~w", [Val]),
Res;
Is there still a reason to not to use more accurate float_to_list?
Eshell V5.5.5 (abort with ^G)
1> A=0.0000012345678.
1.23457e-6
2> io_lib:fwrite("~w", [A]).
[["1.23457",101,45,54]]
3> float_to_list(A).
"1.23456780000000008931e-06"
4>
Jouni
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---
Post recived from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Mon Dec 17, 2007 6:31 pm |
|
|
|
Guest
|
On 12/17/07, Joneksi <Jouni.Ryno@gmail.com> wrote:
>
> Hi
>
> In erlsql.erl:
>
> encode(Val, false) when is_integer(Val) ->
> integer_to_list(Val);
> encode(Val, false) when is_float(Val) ->
> [Res] = io_lib:format("~w", [Val]),
> Res;
>
> Is there still a reason to not to use more accurate float_to_list?
>
> Eshell V5.5.5 (abort with ^G)
> 1> A=0.0000012345678.
> 1.23457e-6
> 2> io_lib:fwrite("~w", [A]).
> [["1.23457",101,45,54]]
> 3> float_to_list(A).
> "1.23456780000000008931e-06"
> 4>
You can get the best of both (compactness and accuracy) with mochinum:digits/1.
http://mochiweb.googlecode.com/svn/trunk/src/mochinum.erl
1> mochinum:digits(0.0000012345678).
"0.0000012345678"
2> float_to_list(0.1).
"1.00000000000000005551e-01"
3> mochinum:digits(0.1).
"0.1"
-bob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---
Post recived from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Wed Dec 19, 2007 12:34 am |
|
|
|
Guest
|
On Dec 17, 2007 10:28 AM, Bob Ippolito <bob@redivi.com> wrote:
>
> On 12/17/07, Joneksi <Jouni.Ryno@gmail.com> wrote:
> >
> > Hi
> >
> > In erlsql.erl:
> >
> > encode(Val, false) when is_integer(Val) ->
> > integer_to_list(Val);
> > encode(Val, false) when is_float(Val) ->
> > [Res] = io_lib:format("~w", [Val]),
> > Res;
> >
> > Is there still a reason to not to use more accurate float_to_list?
> >
> > Eshell V5.5.5 (abort with ^G)
> > 1> A=0.0000012345678.
> > 1.23457e-6
> > 2> io_lib:fwrite("~w", [A]).
> > [["1.23457",101,45,54]]
> > 3> float_to_list(A).
> > "1.23456780000000008931e-06"
> > 4>
>
> You can get the best of both (compactness and accuracy) with mochinum:digits/1.
>
> http://mochiweb.googlecode.com/svn/trunk/src/mochinum.erl
>
> 1> mochinum:digits(0.0000012345678).
> "0.0000012345678"
> 2> float_to_list(0.1).
> "1.00000000000000005551e-01"
> 3> mochinum:digits(0.1).
> "0.1"
>
> -bob
This looks good! The only issue is including it in the ErlyWeb
distribution (I prefer to avoid adding another dependency). Do you see
any problems with that? Do you think this file may change?
Yariv
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---
Post recived from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Wed Dec 19, 2007 3:51 am |
|
|
|
Guest
|
If you're worried about it changing in some way you could always
rename the module or cut+paste the code into something else.
mochinum:digits/1 isn't going anywhere and I doubt its behavior is
going to change beyond a potential performance tweak or two (unless we
find a bug). I'm not going to promise we won't add more functionality
to mochinum though.
On 12/18/07, Yariv Sadan <yarivsadan@gmail.com> wrote:
>
> On Dec 17, 2007 10:28 AM, Bob Ippolito <bob@redivi.com> wrote:
> >
> > On 12/17/07, Joneksi <Jouni.Ryno@gmail.com> wrote:
> > >
> > > Hi
> > >
> > > In erlsql.erl:
> > >
> > > encode(Val, false) when is_integer(Val) ->
> > > integer_to_list(Val);
> > > encode(Val, false) when is_float(Val) ->
> > > [Res] = io_lib:format("~w", [Val]),
> > > Res;
> > >
> > > Is there still a reason to not to use more accurate float_to_list?
> > >
> > > Eshell V5.5.5 (abort with ^G)
> > > 1> A=0.0000012345678.
> > > 1.23457e-6
> > > 2> io_lib:fwrite("~w", [A]).
> > > [["1.23457",101,45,54]]
> > > 3> float_to_list(A).
> > > "1.23456780000000008931e-06"
> > > 4>
> >
> > You can get the best of both (compactness and accuracy) with mochinum:digits/1.
> >
> > http://mochiweb.googlecode.com/svn/trunk/src/mochinum.erl
> >
> > 1> mochinum:digits(0.0000012345678).
> > "0.0000012345678"
> > 2> float_to_list(0.1).
> > "1.00000000000000005551e-01"
> > 3> mochinum:digits(0.1).
> > "0.1"
> >
> > -bob
>
> This looks good! The only issue is including it in the ErlyWeb
> distribution (I prefer to avoid adding another dependency). Do you see
> any problems with that? Do you think this file may change?
>
> Yariv
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---
Post recived from mailinglist |
|
|
| Back to top |
|
| wailian |
Posted: Tue Mar 20, 2012 2:18 am |
|
|
|
Guest
|
| i/p transducer requires a standard input and is for use with linear pneumatic actuators and has high air capacity. It can be easy change of the output signal from. electro pneumatic transducer is used, for example, in the biomedical field for the pneumatic control of a cardiac module, or artificial heart. |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|