How I can convert real number to integer?

We're glad you came by, but you might find what you're looking for elsewhere.

TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it.

Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope.

Forum » Programming & Design / TI-Nspire Programming » How I can convert real number to integer?
Started by: cheesedog cheesedog
Date: 18 May 2021 14:58
Number of posts: 5
rss icon RSS: New posts
Summary:
I want to convert real number to integer: like 1. to 1
How I can convert real number to integer?
cheesedog cheesedog 18 May 2021 14:58

Hello. I am need to convert real number to interger: like

1.

to

1

. but both
round(1.,0)

and
int(1.)

returns
1.

, not
1

. How I can convert Real number like 1. to an integer like 1?
by cheesedog cheesedog , 18 May 2021 14:58
Re: How I can convert real number to integer?
CalcNerd CalcNerd 18 May 2021 21:07

It's possible that the real( command might work. I found that on my TI-83 plus it automatically changed it if you just typed it in when giving the answer. You can also try switching between modes on your calculator to see if that helps.

Hope this helps

3/1.*2
---------
Returns
---------
6

Out of curiosity, what calculator are you trying to do this with?

by CalcNerd CalcNerd , 18 May 2021 21:07
Re: How I can convert real number to integer?
cheesedog cheesedog 19 May 2021 00:24

Mine is TI-Nspire CX II CAS.

by cheesedog cheesedog , 19 May 2021 00:24
Re: How I can convert real number to integer?
CalcNerd CalcNerd 19 May 2021 11:39

I apologize, but I'm not really familiar with that calculator. You can try what I said above, but if that doesn't work you can try just typing it in to see if it automatically converts it. After that, I'm not sure how to help.

Hope you can get it figured out!

by CalcNerd CalcNerd , 19 May 2021 11:39
Re: How I can convert real number to integer?
Xeda Elnara Xeda Elnara 31 May 2021 11:40

The TI-Nspire calcs have a setting for Exact or Approximate calculations. I don't remember off hand, but I think setting it to Approximate will always use floats instead of allowing integers or fractions. Maybe that is the issue? You can also force an expression to evaluate as Approximate if you press one of the mod keys (I don't remember what it is called on the nspires) before pressing Enter.


Z80 Assembly>English>TI-BASIC>Python>French>C>0

Last edited on 31 May 2021 11:40 by Xeda Elnara
by Xeda Elnara Xeda Elnara , 31 May 2021 11:40
/forum/t-14102777/how-i-can-convert-real-number-to-integer#post-
Click here to edit contents of this page.
Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.
Append content without editing the whole page source.
Check out how this page has evolved in the past.
If you want to discuss contents of this page - this is the easiest way to do it.
View and manage file attachments for this page.
A few useful tools to manage this Site.
Change the name (also URL address, possibly the category) of the page.
View wiki source for this page without editing.
View/set parent page (used for creating breadcrumbs and structured layout).
Notify administrators if there is objectionable content in this page.
Something does not work as expected? Find out what you can do.
General Wikidot.com documentation and help section.
Wikidot.com Terms of Service - what you can, what you should not etc.
Wikidot.com Privacy Policy.

AltStyle によって変換されたページ (->オリジナル) /