{
    "mode": "perldoc",
    "parameter": "BSON::Double",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/BSON%3A%3ADouble/json",
    "generated": "2026-06-16T10:42:47Z",
    "synopsis": "use BSON::Types ':all';\nmy $bytes = bsondouble( $number );",
    "sections": {
        "NAME": {
            "content": "BSON::Double - BSON type wrapper for Double\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version v1.12.2\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use BSON::Types ':all';\n\nmy $bytes = bsondouble( $number );\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module provides a BSON type wrapper for a numeric value that would be represented in BSON\nas a double.\n",
            "subsections": []
        },
        "ATTRIBUTES": {
            "content": "value\nA numeric scalar (or the special strings \"Inf\", \"-Inf\" or \"NaN\"). This will be coerced to Perl's\nnumeric type. The default is 0.0.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "TOJSON\nReturns a double.\n\nIf the \"BSONEXTJSON\" environment variable is true and the \"BSONEXTJSONRELAXED\" environment\nvariable is false, returns a hashref compatible with MongoDB's extended JSON\n<https://github.com/mongodb/specifications/blob/master/source/extended-json.rst> format, which\nrepresents it as a document as follows:\n\n{\"$numberDouble\" : \"42.0\"}\n\nIf \"BSONEXTJSON\" is false and the value is 'Inf', '-Inf' or 'NaN' (which are illegal in regular\nJSON), then an exception is thrown.\n",
            "subsections": []
        },
        "INFINITY AND NAN": {
            "content": "Some Perls may not support converting \"Inf\" or \"NaN\" strings to their double equivalent. They\nare available as functions from the POSIX module, but as a lighter alternative to POSIX, the\nfollowing functions are available:\n\n*   BSON::Double::pInf() – positive infinity\n\n*   BSON::Double::nInf() – negative infinity\n\n*   BSON::Double::NaN() – not-a-number\n",
            "subsections": []
        },
        "OVERLOADING": {
            "content": "The numification operator, \"0+\" is overloaded to return the \"value\", the full \"minimal set\" of\noverloaded operations is provided (per overload documentation) and fallback overloading is\nenabled.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "*   David Golden <david@mongodb.com>\n\n*   Stefan G. <minimalist@lavabit.com>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "This software is Copyright (c) 2020 by Stefan G. and MongoDB, Inc.\n\nThis is free software, licensed under:\n\nThe Apache License, Version 2.0, January 2004\n",
            "subsections": []
        }
    },
    "summary": "BSON::Double - BSON type wrapper for Double",
    "flags": [],
    "examples": [],
    "see_also": []
}