Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part! [message #47541 is a reply to message #47540] Thu, 26 January 2017 02:23 Go to previous messageGo to previous message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

I test timings:

Test code:
#include <Core/Core.h>

using namespace Upp;

CONSOLE_APP_MAIN
{
	double a;
	String s = "269.96336996337";
	#define LOOPS 1000000
	for(int i = 0; i < LOOPS; i++){
		RTIMING("Using atof");
		a = atof(s);
	}
	for(int i = 0; i < LOOPS; i++){
		RTIMING("Using ScanDouble");
		a = ScanDouble(s);
	}
}


TIMING results:
TIMING Using ScanDouble:  1.12 s  -  1.12 us ( 1.22 s  / 1000000 ), min:  0.00 ns, max:  1.00 ms, nesting: 1 - 1000000
TIMING Using atof     : 337.45 ms - 337.45 ns (439.00 ms / 1000000 ), min:  0.00 ns, max:  1.00 ms, nesting: 1 - 1000000

It's not dramatically slower! But standard settings (on various environments) show right results!




SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: I propose to Add Postgresql to topic header
Next Topic: How can .sch express a many-to-many relationship ?
Goto Forum:
  


Current Time: Sat May 11 09:04:35 CEST 2024

Total time taken to generate the page: 0.04619 seconds