Skip to main content
guest
Join | Help | Sign In
Liberty BASIC Programmer's Encyc Home
guest| Join | Help | Sign In
Liberty BASIC Programmer's Encyc
  • Wiki Home
  • Recent Changes
  • Pages and Files
  • Members

Home

General Tutorials
Advanced Tutorials
GUI Programming
Graphics and Games
Strings and Text
Numbers and Math
Using Files
Windows API
Communications
Programmer's Tools

Articles by Date
FAQs
Rosetta Code
General Articles
Newsletters Contents

Table of Contents
Demos

Submit Articles
TOS and License

IntegerArithmetic

Edit 3 …
  • 1 Tags
    • math
  • Notify
  • RSS
  • Backlinks
  • Source
  • Print
  • Export (PDF)
Older Version Newer Version

Alyce Alyce Oct 10, 2010

Integer Arithmetic

- CarlGundel CarlGundel

Integer

Liberty BASIC defaults to integer arithmethic unless you do something that produces a floating point result. For example:

 a = 3 + 4 'integer calculation 
for x = 1 to 10 'integer calculation

Floating Point

Or floating point:

 a = 0.3 + 0.4 'floating point 

Convert Float to Integer

If a floating point result has a zero fractional part (this doesn't happen too often), then LB will convert it to an integer number on assignment. This is dependent on the math processor, and probably other variables.

 a = 0.3 + 0.7 'may become an integer on assignment 

-Carl
Help · About · Pricing · Privacy · Terms · Support · Upgrade
Contributions to https://lbpe.wikispaces.com/ are licensed under a Custom License.
Portions not contributed by visitors are Copyright 2018 Tangient LLC
TES: The largest network of teachers in the world
Turn off "Getting Started"
  1. Home
  2. ...
Loading...