Documentation #124

unexpected change of range-check for SHORT(ENTIER(real)) instruction

Added by Ivan Denisov 6 days ago. Updated 6 days ago.

Status:In ProgressStart date:08/22/2016
Priority:NormalDue date:
Assignee:Robert Campbell% Done:

90%

Category:-
Target version:1.7

Description

according the language report
ENTIER(real-val) return LONGINT,
SHORT(longint-val) return INTEGER

so SHORT(ENTIER(real-val)) will return INTEGER;

the current BB compiler has a range-check for ENTIER(real), the real should can be round into a valid LONGINT.
otherwise will trap;but this is not documented.

the Robert's example let us known the expression SHORT(ENTIER(real)) has change the range-check from LONGINT to INTEGER,

IMO, it is a bad idea,it broken the ENTIER() defination,confuse user and harmful for code's rubost.

for expression SHORT(ENTIER(real)), the logic should be:
ENTIER(real) reutrn LONGINT, whith range-check (LONGINT );SHORT(longint) return INTEGER.

- LuoWe (http://forum.blackboxframework.org/viewtopic.php?f=33&t=495&p=4408#p4408)


Add

Subtasks


Add

Related issues

Associated revisions

Revision 16126259
Added by Ivan Denisov 6 days ago

Range check for SHORT) was fixed by LuoWy, bug was found by Robert Campbell. Refs: #124.

Revision 01ccb3fb
Added by Ivan Denisov 6 days ago

Range check for SHORT) fix was improved by LuoWy. Refs: #124.

Revision d54984d0
Added by Ivan Denisov 6 days ago

Free registers for the previous fix. Refs: #124.

Revision 05ccd885
Added by Ivan Denisov 6 days ago

One more fix for compiler exeptions handling. Refs: #124.

History

#1 Updated by Ivan Denisov 6 days ago

  • Description updated (diff)

#2 Updated by Ivan Denisov 6 days ago

  • Tracker changed from Bug to Documentation
  • Assignee changed from WenYing Luo to Robert Campbell

Also available in: Atom PDF