If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Ruby constants
2 posts
• Page 1 of 1
Ruby constants
Hi,
Stupid question, but still... Any hint on how can I use mathematical constants in ruby?
I want o use 'exp' (natural exponent = 2.71...) or Pi (=3.1415...) in Ruby and looking for a short way to type it in.
I was trying E, math.E, etc but couldn't find a way.
Google didn't help much either...
The only solution I found so far is to define a constant at start of Ruby code, example:
@E=Math.exp(1)
But I guess there is a better way ??
Thanks
Stupid question, but still... Any hint on how can I use mathematical constants in ruby?
I want o use 'exp' (natural exponent = 2.71...) or Pi (=3.1415...) in Ruby and looking for a short way to type it in.
I was trying E, math.E, etc but couldn't find a way.
Google didn't help much either...
The only solution I found so far is to define a constant at start of Ruby code, example:
@E=Math.exp(1)
But I guess there is a better way ??
Thanks
- Rocko
- Posts: 186
- Joined: Tue May 15, 2012 12:42 pm
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 83 guests