Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Determine a value is INTEGER
#18
(07-27-2024, 04:30 AM)DSMan195276 Wrote: @KernelPanic that's possible to do with `Declare Library` but the `INT` command is actually just `std::floor` already.
That's right, one can do that with Basic too! That's why it seemed a bit strange to me, I hadn't thought of INT.  Sad

Code: (Select All)

'Gleitkommazahl in Ganzzahligen- und Nachkommateil aufteilen - 27. Juli 2024

Option _Explicit

Dim As Double eingabe, vorKomma, nachKomma

Print
Input "Fliesskommazahl eingeben: ", eingabe

'Nachkommarest ermitteln
nachKomma = Abs(eingabe - Fix(eingabe))

'Vorkommateil, ganzzahliger Teil
vorKomma = eingabe - nachKomma

Print
Print Using "Ganzzahliger Teil: ####"; vorKomma
Print
Print Using "Nachkommateil    : .###"; nachKomma

Print: Print
Print Using "Ganzzahliger Teil mit INT: ####"; Int(eingabe)

End
Reply


Messages In This Thread
Determine a value is INTEGER - by TerryRitchie - 07-25-2024, 07:40 PM
RE: Determine a value is INTEGER - by DSMan195276 - 07-26-2024, 12:17 AM
RE: Determine a value is INTEGER - by Pete - 07-26-2024, 12:23 AM
RE: Determine a value is INTEGER - by DSMan195276 - 07-26-2024, 02:33 AM
RE: Determine a value is INTEGER - by Pete - 07-26-2024, 02:41 AM
RE: Determine a value is INTEGER - by Jack - 07-26-2024, 12:25 PM
RE: Determine a value is INTEGER - by Petr - 07-26-2024, 03:02 PM
RE: Determine a value is INTEGER - by Jack - 07-26-2024, 05:25 PM
RE: Determine a value is INTEGER - by DSMan195276 - 07-26-2024, 07:02 PM
RE: Determine a value is INTEGER - by Jack - 07-26-2024, 08:14 PM
RE: Determine a value is INTEGER - by Kernelpanic - 07-26-2024, 10:57 PM
RE: Determine a value is INTEGER - by DSMan195276 - 07-27-2024, 04:30 AM
RE: Determine a value is INTEGER - by Kernelpanic - 07-27-2024, 05:03 PM
RE: Determine a value is INTEGER - by SMcNeill - 07-27-2024, 01:49 PM
RE: Determine a value is INTEGER - by bplus - 07-27-2024, 02:43 PM



Users browsing this thread: 2 Guest(s)