Bug report #9554

Strange errors working with 10 digit real or integers

Added by magerlin - about 6 years ago. Updated over 5 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Vectors
Affected QGIS version:2.0.1 Regression?:No
Operating System:Win Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:Yes Copied to github as #:18141

Description

When doing this calculation in field calculator on a shape file:

FromToStop = 100000 * From_stop + To_stop

results are sometimes negative even though From_stop and TO_stop are positive.

Error occurs both with integers and real numbers.

Directly writing a 10 digit number in an attribute in Field Calculater gives strange results too at least if the field is real 20.0:

Writing 1111111111 is OK but writing 2222222222 returns the value -2147483648 after saving.

See more here: http://osgeo-org.1560.x6.nabble.com/Error-in-simple-calculation-in-Field-Calculator-td5102486.html

I am using version 2.0.1 installed from OSGeo4W.

Test.zip - Test data (1.43 KB) magerlin -, 2014-02-13 12:38 AM

History

#1 Updated by Jürgen Fischer almost 6 years ago

  • Category set to Vectors

#2 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to duplicate
  • Status changed from Open to Closed

duplicate of #4766

Also available in: Atom PDF