Temperature compare
temperature-compare · version 1.0.0 · Units & sizes · free, no key needed
Compare two temperatures in C, F, or K by converting both to Kelvin rationals.
Use when you need to: temperature compare · compare temperatures across units · order celsius fahrenheit kelvin.
Decide before calling
Read the versioned contract and the supported scope below. Reuse temperature-compare@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use temperature-compare@1.0.0 for temperature compare. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- temperature compare
- compare temperatures across units
- order celsius fahrenheit kelvin
Not supported
- average temperatures
- sort a temperature list
- Rankine
- IEEE-754 floats
Behavior
- left and right are objects with a canonical decimal value and a unit of C, F, or K.
- Both readings are converted to Kelvin with K = C + 5463/20 and F = C * 9/5 + 32.
- Temperatures below absolute zero (K < 0) are rejected.
- cmp is -1, 0, or 1 for left <, =, or > right after the Kelvin conversion.
Input
left(object, required)right(object, required)
Output
cmp(one of -1, 0, 1, required)
Limits
- max digits before point: 20
- max fractional digits: 10
Example
Request input:
{
"left": {
"value": "0",
"unit": "C"
},
"right": {
"value": "32",
"unit": "F"
}
}
Response:
{
"result": {
"cmp": 0
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "temperature-compare",
"version": "1.0.0",
"input": {
"left": {
"value": "0",
"unit": "C"
},
"right": {
"value": "32",
"unit": "F"
}
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/temperature-compare/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"left":{"value":"0","unit":"C"},"right":{"value":"32","unit":"F"}}'
The machine-readable contract is at /v1/tools/temperature-compare/versions/1.0.0.
CLI
node cli.mjs run temperature-compare 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Temperature convert: Convert a decimal temperature between Celsius, Fahrenheit, and Kelvin as an exact rational.
- Volume unit convert: Convert exact decimal volumes among SI, cubic, US liquid, and imperial units with explicit half-even rounding.
- Area unit convert: Convert an exact decimal area among ten SI, imperial, acre, and hectare units using pinned rational factors.
- Byte size compare: Compare two non-negative integer byte sizes by exact byte amounts.
- Byte size convert: Convert a non-negative integer byte size between IEC binary units as an exact rational.
- Css length convert: Convert px, pt, pc, in, cm, mm, or Q using exact CSS ratios; returns a rounded decimal value.