473,786 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Numeric type problems

Hi All,

I hope this is the correct mailing list for this question. But neither
postgresql.org nor google could help me out on this subject.
I did find one disturbing topic on the mailing list archives
(http://archives.postgresql.org/pgsql.../msg00032.php), but
since it was quite old I'm posting my question anyway.

I'm writing a generic database layer that should support a fixed number
of generic numeric types on a number of databases. At this point it
supports MySQL just fine, but I'm having some trouble finding the right
implementation details for PostgreSQL. Please take a moment to look at
the following table. The field description speaks for itself pretty much
I guess.

Field descr. MySQL PostgreSQL
=============== =============== =============== =============== ==========
DB_FIELD_INT8 TINYINT SMALLINT (too big, but best match)
DB_FIELD_INT16 SMALLINT SMALLINT
DB_FIELD_INT32 INT INT
DB_FIELD_INT64 BIGINT BIGINT
DB_FIELD_UINT8 TINYINT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT16 SMALLINT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT32 INT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT64 BIGINT UNSIGNED <not supported natively, is it?>
DB_FIELD_FLOAT FLOAT REAL
DB_FIELD_DOUBLE DOUBLE DOUBLE PRECISION

My problem is obvisouly the unsigned values I really need to be able to
represent properly. I know I can just use the twice as big signed types
and put a constraint on it, but that only works for UINT8, UINT16 and
UINT32 (there is no 128-bit signed integer type, right?): I really need
to have proper 64-bit unsigned integer value support.

I *could* use a BIGINT to represent 64-bit unsigned values, and just
cast the binary data to an unsigned long long (or unsigned __int64 on
win32), but this would leave me with the problem that I couldn't safely
let SQL do comparisons on the value, right?

Is there any solution? I've seen someone suggesting elsewhere that one
should use the OID type, but others said that one shouldn't. I'm pretty
desperate. PostgreSQL would really be my database of choice for our
current project, but I'm afraid we can't use it if I can't get this right...

Thanks in advance for any help!

Bye,
Marc

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
6 9230
Use a numeric type if you need more precision.

template1=# create domain BIGINT_UNSIGNED numeric(20,0) check (value >=
0 and value < '18446744073709 551616'::numeri c(20,0));
CREATE DOMAIN
template1=# create table foobar (i BIGINT_UNSIGNED );
CREATE TABLE
template1=# insert into foobar (i) values (-1); --too small
ERROR: value for domain bigint_unsigned violates check constraint "$1"
template1=# insert into foobar (i) values (0); -- works
INSERT 17159 1
template1=# insert into foobar (i) values (pow(2::numeric , 64::numeric)
- 1); --works
INSERT 17160 1
template1=# insert into foobar (i) values (pow(2::numeric ,
64::numeric)); --too large
ERROR: value for domain bigint_unsigned violates check constraint "$1"
template1=# select * from foobar;
i
----------------------
0
184467440737095 51615
(2 rows)

Paul Tillotson
Hi All,

I hope this is the correct mailing list for this question. But neither
postgresql.org nor google could help me out on this subject.
I did find one disturbing topic on the mailing list archives
(http://archives.postgresql.org/pgsql.../msg00032.php), but
since it was quite old I'm posting my question anyway.

I'm writing a generic database layer that should support a fixed
number of generic numeric types on a number of databases. At this
point it supports MySQL just fine, but I'm having some trouble finding
the right implementation details for PostgreSQL. Please take a moment
to look at the following table. The field description speaks for
itself pretty much I guess.

Field descr. MySQL PostgreSQL
=============== =============== =============== =============== ==========
DB_FIELD_INT8 TINYINT SMALLINT (too big, but best match)
DB_FIELD_INT16 SMALLINT SMALLINT
DB_FIELD_INT32 INT INT
DB_FIELD_INT64 BIGINT BIGINT
DB_FIELD_UINT8 TINYINT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT16 SMALLINT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT32 INT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT64 BIGINT UNSIGNED <not supported natively, is it?>
DB_FIELD_FLOAT FLOAT REAL
DB_FIELD_DOUBLE DOUBLE DOUBLE PRECISION

My problem is obvisouly the unsigned values I really need to be able
to represent properly. I know I can just use the twice as big signed
types and put a constraint on it, but that only works for UINT8,
UINT16 and UINT32 (there is no 128-bit signed integer type, right?): I
really need to have proper 64-bit unsigned integer value support.

I *could* use a BIGINT to represent 64-bit unsigned values, and just
cast the binary data to an unsigned long long (or unsigned __int64 on
win32), but this would leave me with the problem that I couldn't
safely let SQL do comparisons on the value, right?

Is there any solution? I've seen someone suggesting elsewhere that one
should use the OID type, but others said that one shouldn't. I'm
pretty desperate. PostgreSQL would really be my database of choice for
our current project, but I'm afraid we can't use it if I can't get
this right...

Thanks in advance for any help!

Bye,
Marc

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #2
Use a numeric type if you need more precision.

template1=# create domain BIGINT_UNSIGNED numeric(20,0) check (value >=
0 and value < '18446744073709 551616'::numeri c(20,0));
CREATE DOMAIN
template1=# create table foobar (i BIGINT_UNSIGNED );
CREATE TABLE
template1=# insert into foobar (i) values (-1); --too small
ERROR: value for domain bigint_unsigned violates check constraint "$1"
template1=# insert into foobar (i) values (0); -- works
INSERT 17159 1
template1=# insert into foobar (i) values (pow(2::numeric , 64::numeric)
- 1); --works
INSERT 17160 1
template1=# insert into foobar (i) values (pow(2::numeric ,
64::numeric)); --too large
ERROR: value for domain bigint_unsigned violates check constraint "$1"
template1=# select * from foobar;
i
----------------------
0
184467440737095 51615
(2 rows)

Paul Tillotson
Hi All,

I hope this is the correct mailing list for this question. But neither
postgresql.org nor google could help me out on this subject.
I did find one disturbing topic on the mailing list archives
(http://archives.postgresql.org/pgsql.../msg00032.php), but
since it was quite old I'm posting my question anyway.

I'm writing a generic database layer that should support a fixed
number of generic numeric types on a number of databases. At this
point it supports MySQL just fine, but I'm having some trouble finding
the right implementation details for PostgreSQL. Please take a moment
to look at the following table. The field description speaks for
itself pretty much I guess.

Field descr. MySQL PostgreSQL
=============== =============== =============== =============== ==========
DB_FIELD_INT8 TINYINT SMALLINT (too big, but best match)
DB_FIELD_INT16 SMALLINT SMALLINT
DB_FIELD_INT32 INT INT
DB_FIELD_INT64 BIGINT BIGINT
DB_FIELD_UINT8 TINYINT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT16 SMALLINT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT32 INT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT64 BIGINT UNSIGNED <not supported natively, is it?>
DB_FIELD_FLOAT FLOAT REAL
DB_FIELD_DOUBLE DOUBLE DOUBLE PRECISION

My problem is obvisouly the unsigned values I really need to be able
to represent properly. I know I can just use the twice as big signed
types and put a constraint on it, but that only works for UINT8,
UINT16 and UINT32 (there is no 128-bit signed integer type, right?): I
really need to have proper 64-bit unsigned integer value support.

I *could* use a BIGINT to represent 64-bit unsigned values, and just
cast the binary data to an unsigned long long (or unsigned __int64 on
win32), but this would leave me with the problem that I couldn't
safely let SQL do comparisons on the value, right?

Is there any solution? I've seen someone suggesting elsewhere that one
should use the OID type, but others said that one shouldn't. I'm
pretty desperate. PostgreSQL would really be my database of choice for
our current project, but I'm afraid we can't use it if I can't get
this right...

Thanks in advance for any help!

Bye,
Marc

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #3
This is a very interesting option. My biggest concern is performance:
the project will require tables with millions of tuples. How does the
performance of such user created types compare to using native types? Or
are they 'built' using the same structure?

Thanks again!

Marc
Paul Tillotson wrote:
Use a numeric type if you need more precision.

template1=# create domain BIGINT_UNSIGNED numeric(20,0) check (value >=
0 and value < '18446744073709 551616'::numeri c(20,0));
CREATE DOMAIN
template1=# create table foobar (i BIGINT_UNSIGNED );
CREATE TABLE
template1=# insert into foobar (i) values (-1); --too small
ERROR: value for domain bigint_unsigned violates check constraint "$1"
template1=# insert into foobar (i) values (0); -- works
INSERT 17159 1
template1=# insert into foobar (i) values (pow(2::numeric , 64::numeric)
- 1); --works
INSERT 17160 1
template1=# insert into foobar (i) values (pow(2::numeric ,
64::numeric)); --too large
ERROR: value for domain bigint_unsigned violates check constraint "$1"
template1=# select * from foobar;
i
----------------------
0
184467440737095 51615
(2 rows)

Paul Tillotson
Hi All,

I hope this is the correct mailing list for this question. But neither
postgresql.org nor google could help me out on this subject.
I did find one disturbing topic on the mailing list archives
(http://archives.postgresql.org/pgsql.../msg00032.php), but
since it was quite old I'm posting my question anyway.

I'm writing a generic database layer that should support a fixed
number of generic numeric types on a number of databases. At this
point it supports MySQL just fine, but I'm having some trouble finding
the right implementation details for PostgreSQL. Please take a moment
to look at the following table. The field description speaks for
itself pretty much I guess.

Field descr. MySQL PostgreSQL
=============== =============== =============== =============== ==========
DB_FIELD_INT8 TINYINT SMALLINT (too big, but best match)
DB_FIELD_INT16 SMALLINT SMALLINT
DB_FIELD_INT32 INT INT
DB_FIELD_INT64 BIGINT BIGINT
DB_FIELD_UINT8 TINYINT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT16 SMALLINT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT32 INT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT64 BIGINT UNSIGNED <not supported natively, is it?>
DB_FIELD_FLOAT FLOAT REAL
DB_FIELD_DOUBLE DOUBLE DOUBLE PRECISION

My problem is obvisouly the unsigned values I really need to be able
to represent properly. I know I can just use the twice as big signed
types and put a constraint on it, but that only works for UINT8,
UINT16 and UINT32 (there is no 128-bit signed integer type, right?): I
really need to have proper 64-bit unsigned integer value support.

I *could* use a BIGINT to represent 64-bit unsigned values, and just
cast the binary data to an unsigned long long (or unsigned __int64 on
win32), but this would leave me with the problem that I couldn't
safely let SQL do comparisons on the value, right?

Is there any solution? I've seen someone suggesting elsewhere that one
should use the OID type, but others said that one shouldn't. I'm
pretty desperate. PostgreSQL would really be my database of choice for
our current project, but I'm afraid we can't use it if I can't get
this right...

Thanks in advance for any help!

Bye,
Marc

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly



--
Bye,
Marc 'Foddex' Oude Kotte

-=-=-=-=-=-=-=-=-=-=-=-=-
Need a programmer?
Go to http://www.foddex.net

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #4
This is a very interesting option. My biggest concern is performance:
the project will require tables with millions of tuples. How does the
performance of such user created types compare to using native types? Or
are they 'built' using the same structure?

Thanks again!

Marc
Paul Tillotson wrote:
Use a numeric type if you need more precision.

template1=# create domain BIGINT_UNSIGNED numeric(20,0) check (value >=
0 and value < '18446744073709 551616'::numeri c(20,0));
CREATE DOMAIN
template1=# create table foobar (i BIGINT_UNSIGNED );
CREATE TABLE
template1=# insert into foobar (i) values (-1); --too small
ERROR: value for domain bigint_unsigned violates check constraint "$1"
template1=# insert into foobar (i) values (0); -- works
INSERT 17159 1
template1=# insert into foobar (i) values (pow(2::numeric , 64::numeric)
- 1); --works
INSERT 17160 1
template1=# insert into foobar (i) values (pow(2::numeric ,
64::numeric)); --too large
ERROR: value for domain bigint_unsigned violates check constraint "$1"
template1=# select * from foobar;
i
----------------------
0
184467440737095 51615
(2 rows)

Paul Tillotson
Hi All,

I hope this is the correct mailing list for this question. But neither
postgresql.org nor google could help me out on this subject.
I did find one disturbing topic on the mailing list archives
(http://archives.postgresql.org/pgsql.../msg00032.php), but
since it was quite old I'm posting my question anyway.

I'm writing a generic database layer that should support a fixed
number of generic numeric types on a number of databases. At this
point it supports MySQL just fine, but I'm having some trouble finding
the right implementation details for PostgreSQL. Please take a moment
to look at the following table. The field description speaks for
itself pretty much I guess.

Field descr. MySQL PostgreSQL
=============== =============== =============== =============== ==========
DB_FIELD_INT8 TINYINT SMALLINT (too big, but best match)
DB_FIELD_INT16 SMALLINT SMALLINT
DB_FIELD_INT32 INT INT
DB_FIELD_INT64 BIGINT BIGINT
DB_FIELD_UINT8 TINYINT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT16 SMALLINT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT32 INT UNSIGNED <not supported natively, is it?>
DB_FIELD_UINT64 BIGINT UNSIGNED <not supported natively, is it?>
DB_FIELD_FLOAT FLOAT REAL
DB_FIELD_DOUBLE DOUBLE DOUBLE PRECISION

My problem is obvisouly the unsigned values I really need to be able
to represent properly. I know I can just use the twice as big signed
types and put a constraint on it, but that only works for UINT8,
UINT16 and UINT32 (there is no 128-bit signed integer type, right?): I
really need to have proper 64-bit unsigned integer value support.

I *could* use a BIGINT to represent 64-bit unsigned values, and just
cast the binary data to an unsigned long long (or unsigned __int64 on
win32), but this would leave me with the problem that I couldn't
safely let SQL do comparisons on the value, right?

Is there any solution? I've seen someone suggesting elsewhere that one
should use the OID type, but others said that one shouldn't. I'm
pretty desperate. PostgreSQL would really be my database of choice for
our current project, but I'm afraid we can't use it if I can't get
this right...

Thanks in advance for any help!

Bye,
Marc

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly



--
Bye,
Marc 'Foddex' Oude Kotte

-=-=-=-=-=-=-=-=-=-=-=-=-
Need a programmer?
Go to http://www.foddex.net

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #5
First, every type in postgres is user-defined, in the sense that its
binary structure and the arithmetic and comparison operations you can
perform on it are defined by a set of native C functions that are
present in the database executable or loaded as shared libraries.
Because of postgres's extensible type system, all types share a small
performance penalty, but you can make new ones that are just as efficient.

http://www.postgresql.org/docs/7.4/s...reatetype.html
http://www.postgresql.org/docs/7.4/s...teopclass.html

If you need a high performance unsigned 64 bit integer, you should make
your own type, using the existing bigint type as a template, which
should be just as efficient as the "builtin" bigint type. This is
probably premature optimization though.

Also note that if you're trying to make a type that will merely hold a
MySQL BIGINT UNSIGNED, and you want low overhead, then numeric(20)
without the check constraint will do nicely. Since MySQL itself doesn't
check to see if the values you are inserting are negative or too big*,
then presumably that responsibility doesn't fall on you either. If you
are trying to make something that is bug-for-bug compatible with MySQL,
then you'd better start working on the user defined type.

Personally, I am curious to know what sort of application you are
writing that requires storing numbers

- larger than 2 ** 63 (otherwise you would just use signed bigint)
- but less than 2 ** 64 (as far as I know you can't do this in MySQL
anyway, although you can in postgres)
- with exact precision (otherwise you would use floating point),
- but without any requirements for checking the validity of input (since
MySQL won't do this for you.)
- and without any requirements for being able to math "in the database"
and get a valid answer. (why don't you store it as a string?)

Paul Tillotson

*As evidenced:

mysql> create table foobar (i bigint unsigned);
Query OK, 0 rows affected (0.00 sec)

mysql> insert into foobar values (-3);
Query OK, 1 row affected (0.00 sec)

mysql> insert into foobar values (1000000000 * 1000000000000);
Query OK, 1 row affected (0.00 sec)

mysql> insert into foobar values (10000000000000 00000000);
Query OK, 1 row affected (0.00 sec)

mysql> select * from foobar;
+----------------------+
| i |
+----------------------+
| 184467440737095 51613 |
| 387582001968421 2736 |
| 184467440737095 51615 |
+----------------------+
3 rows in set (0.00 sec)

mysql> update foobar set i = -i;
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0

mysql> select * from foobar;
+----------------------+
| i |
+----------------------+
| 3 |
| 145709240540253 38880 |
| 1 |
+----------------------+
3 rows in set (0.00 sec)

M.A. Oude Kotte wrote:
This is a very interesting option. My biggest concern is performance:
the project will require tables with millions of tuples. How does the
performance of such user created types compare to using native types?
Or are they 'built' using the same structure?

Thanks again!

Marc
Paul Tillotson wrote:
Use a numeric type if you need more precision.

template1=# create domain BIGINT_UNSIGNED numeric(20,0) check (value
>= 0 and value < '18446744073709 551616'::numeri c(20,0));

CREATE DOMAIN
template1=# create table foobar (i BIGINT_UNSIGNED );
CREATE TABLE
template1=# insert into foobar (i) values (-1); --too small
ERROR: value for domain bigint_unsigned violates check constraint "$1"
template1=# insert into foobar (i) values (0); -- works
INSERT 17159 1
template1=# insert into foobar (i) values (pow(2::numeric ,
64::numeric) - 1); --works
INSERT 17160 1
template1=# insert into foobar (i) values (pow(2::numeric ,
64::numeric)); --too large
ERROR: value for domain bigint_unsigned violates check constraint "$1"
template1=# select * from foobar;
i
----------------------
0
184467440737095 51615
(2 rows)

Paul Tillotson

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #6
First, every type in postgres is user-defined, in the sense that its
binary structure and the arithmetic and comparison operations you can
perform on it are defined by a set of native C functions that are
present in the database executable or loaded as shared libraries.
Because of postgres's extensible type system, all types share a small
performance penalty, but you can make new ones that are just as efficient.

http://www.postgresql.org/docs/7.4/s...reatetype.html
http://www.postgresql.org/docs/7.4/s...teopclass.html

If you need a high performance unsigned 64 bit integer, you should make
your own type, using the existing bigint type as a template, which
should be just as efficient as the "builtin" bigint type. This is
probably premature optimization though.

Also note that if you're trying to make a type that will merely hold a
MySQL BIGINT UNSIGNED, and you want low overhead, then numeric(20)
without the check constraint will do nicely. Since MySQL itself doesn't
check to see if the values you are inserting are negative or too big*,
then presumably that responsibility doesn't fall on you either. If you
are trying to make something that is bug-for-bug compatible with MySQL,
then you'd better start working on the user defined type.

Personally, I am curious to know what sort of application you are
writing that requires storing numbers

- larger than 2 ** 63 (otherwise you would just use signed bigint)
- but less than 2 ** 64 (as far as I know you can't do this in MySQL
anyway, although you can in postgres)
- with exact precision (otherwise you would use floating point),
- but without any requirements for checking the validity of input (since
MySQL won't do this for you.)
- and without any requirements for being able to math "in the database"
and get a valid answer. (why don't you store it as a string?)

Paul Tillotson

*As evidenced:

mysql> create table foobar (i bigint unsigned);
Query OK, 0 rows affected (0.00 sec)

mysql> insert into foobar values (-3);
Query OK, 1 row affected (0.00 sec)

mysql> insert into foobar values (1000000000 * 1000000000000);
Query OK, 1 row affected (0.00 sec)

mysql> insert into foobar values (10000000000000 00000000);
Query OK, 1 row affected (0.00 sec)

mysql> select * from foobar;
+----------------------+
| i |
+----------------------+
| 184467440737095 51613 |
| 387582001968421 2736 |
| 184467440737095 51615 |
+----------------------+
3 rows in set (0.00 sec)

mysql> update foobar set i = -i;
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0

mysql> select * from foobar;
+----------------------+
| i |
+----------------------+
| 3 |
| 145709240540253 38880 |
| 1 |
+----------------------+
3 rows in set (0.00 sec)

M.A. Oude Kotte wrote:
This is a very interesting option. My biggest concern is performance:
the project will require tables with millions of tuples. How does the
performance of such user created types compare to using native types?
Or are they 'built' using the same structure?

Thanks again!

Marc
Paul Tillotson wrote:
Use a numeric type if you need more precision.

template1=# create domain BIGINT_UNSIGNED numeric(20,0) check (value
>= 0 and value < '18446744073709 551616'::numeri c(20,0));

CREATE DOMAIN
template1=# create table foobar (i BIGINT_UNSIGNED );
CREATE TABLE
template1=# insert into foobar (i) values (-1); --too small
ERROR: value for domain bigint_unsigned violates check constraint "$1"
template1=# insert into foobar (i) values (0); -- works
INSERT 17159 1
template1=# insert into foobar (i) values (pow(2::numeric ,
64::numeric) - 1); --works
INSERT 17160 1
template1=# insert into foobar (i) values (pow(2::numeric ,
64::numeric)); --too large
ERROR: value for domain bigint_unsigned violates check constraint "$1"
template1=# select * from foobar;
i
----------------------
0
184467440737095 51615
(2 rows)

Paul Tillotson

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3082
by: drife | last post by:
Hello, Could someone please provide instructions for install Numeric with ATLAS and LAPACK? I've actually done this correctly, I think. But I don't see any difference in the speed. I'm calculating eigenvalues for a 3600 X 3600 covariance matrix.
5
2370
by: bandw | last post by:
I am having a problem using Numeric-24.0b2 in conjunction with the NetCDF module from ScientificPython (version 2.4.9). This problem does not surface using Numeric-23.8. The problem arises in using the "min" function on a NetCDF floating array. In 23.8, the "min" function returns a floating scalar, while in 24.0b2 it returns an *array* of length "1". Below I list a simple NetCDF file and a Python script that illustrate the problem. When I...
7
3943
by: BBFrost | last post by:
I'm receiving decimal values from database queries and placing them on a report page. The users want to see the following .... Db Value Display Value 123.3400 123.34 123.0000 123 i.e. I want to trim trailing zeros and (decimal point if no decimal values
2
5037
by: John A Grandy | last post by:
how do VB.NET numeric data-types match-up to SQL-Server numeric data-types ? is it safe to use declare VB.NET variables of type Integer to contain SQL Server columns of type Integer ?
0
1243
by: M.A. Oude Kotte | last post by:
Hi All, I hope this is the correct mailing list for this question. But neither postgresql.org nor google could help me out on this subject. I did find one disturbing topic on the mailing list archives (http://archives.postgresql.org/pgsql-admin/2000-05/msg00032.php), but since it was quite old I'm posting my question anyway. I'm writing a generic database layer that should support a fixed number of generic numeric types on a number of...
3
2425
by: AdamM | last post by:
Hi all, What function lets me check a text string and determine if that string is really a int, float, double, etc. just formatted as a string? Thanks in advance! Adam
1
2388
by: frasmus | last post by:
*Please excuse me for cross-posting. I really can't find a suitable "wireless internet" group to ask this question, except forum.nokia, where I didn't have any luck. I have a web page for inputting personal expenses into a financial database with a cell phone. To force numeric values on the keypad, I used <input name="num" width="70" height="20" format="*NNNN/" type="Currency" align="right"> The page works just great with the free...
0
2119
by: ronysk | last post by:
Hi, I am posting here to seek for help on type conversion between Python (Numeric Python) and C. Attachment A is a math function written in C, which is called by a Python program. I had studied SWIG and Python/C API a bit. I was able to pass numeric array (Numeric Python) into the C function and access/change these arrays. Problem I am having is that I couldn't quite get the array converted back to some PyObject or something that...
2
1275
by: Arthur Dent | last post by:
Hi all... I'm playing around experimenting with Extensions and R&D'ing what's new. There's a procedure I would like to add to numbers, and I was wondering, is there any "base" number type, that I could put an extension on, as opposed to manually adding it to all the numeric types... decimal, double, single, long, short, etc... ?? Cheers!
0
9650
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8992
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6748
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.