Why is `0.0 / 0.0` preferred over using NaN

未关闭
#11,028 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
冷清
领域
build-system

调研方向

从引用的 lib/node_modules/@stdlib/stats/base/dists/negative-binomial/skewness/src/main.c 行开始,检查 native add-on 如何使用 MSVC 进行编译。在仓库中搜索 0.0 / 0.0 和 NAN 的类似用法,然后重现报告的编译问题;完成的标准是记录可移植性理由以及任何必要的后续工作。

由索引模型根据 Issue 内容生成。

描述

Question
Description

Encountered an error when compiling native add-ons with MSVC.

Why do we prefer returning 0.0 / 0.0 instead of NAN from <math.h>?

Example:

https://github.com/stdlib-js/stdlib/blob/a1f8442b4ed11aceb97c2b5e6e7e8fdc18d8317b/lib/node_modules/%40stdlib/stats/base/dists/negative-binomial/skewness/src/main.c#L42

Related Issues

No response

Questions

No.

Demo

No response

Reproduction

Expected Results

Actual Results

Version

No response

Environments

Node.js

Browser Version

No response

Node.js / npm Version

No response

Platform

No response

Checklist
  • Read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
主要语言
JavaScript
星标
6k
派生
1.3k
平均合并
1 天 21 小时
30 天内合并 PR
224

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

stdlib-js/stdlib 的其他 Issue

查看 stdlib-js/stdlib 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。