GET
/v1/floats
QuBitLang
Returns IEEE 754 double-precision random floating-point numbers between 0 and 1. Perfect for Monte Carlo simulations, statistical sampling, and probabilistic algorithms.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| count | integer | No | 1 | Number of floats to generate (1–10,000) |
| precision | integer | No | 10 | Decimal precision (1–16) |
Code Examples
floats.py
from trueentropy import TrueEntropy
client = TrueEntropy(api_key="te_live_YOUR_KEY")
result = client.floats(
count=5,
precision=10
)
print(result.values)
# [0.4721938451, 0.8291056834, 0.1347829156, 0.9518234076, 0.3062891547]
floats.js
import { TrueEntropy } from '@trueentropy/sdk';
const client = new TrueEntropy('te_live_YOUR_KEY');
const result = await client.floats({
count: 5,
precision: 10
});
console.log(result.data.values);
// [0.4721938451, 0.8291056834, ...]
floats.php
use TrueEntropy\Client;
$client = new Client('te_live_YOUR_KEY');
$result = $client->floats([
'count' => 5,
'precision' => 10,
]);
print_r($result->values);
Terminal
curl https://api.trueentropy.net/v1/floats \
-H "Authorization: Bearer te_live_YOUR_KEY" \
-G -d "count=5&precision=10"
Response
200 OKJSON
{
"data": {
"values": [0.4721938451, 0.8291056834, 0.1347829156],
"count": 3,
"precision": 10
},
"metadata": {
"request_id": "req_c3d4e5f6a7b8",
"timestamp": "2026-03-09T15:42:17Z",
"qubitlang_circuit": "qrng_hadamard_v2.3",
"qubitlang_version": "1.4.0",
"quantum_backend": "ibm_fez",
"nist_verified": true,
"certificate_id": "cert_c3d4e5f6a7b8",
"powered_by": "QuBitLang"
}
}
Response Headers
X-QuBitLang-Circuit: qrng_hadamard_v2.3
X-QuBitLang-Version: 1.4.0
X-Quantum-Backend: ibm_fez
X-NIST-Verified: true
X-RateLimit-Remaining: 47
X-RateLimit-Reset: 1741536180
Errors
| Status | Code | Description |
|---|---|---|
| 400 | invalid_count | count must be between 1 and 10,000 |
| 400 | invalid_precision | precision must be between 1 and 16 |
| 401 | auth_missing | No API key provided |
| 401 | auth_invalid | API key is invalid or revoked |
| 429 | rate_limited | Rate limit exceeded |