GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - astrozig/codata.zig: Zig library providing physical constants and reference data based on the CODATA recommended values.

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
data
data
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.zig
build.zig
 
 
build.zig.zon
build.zig.zon
 
 

Repository files navigation

codata.zig

codata.zig is a Zig library providing physical constants and reference data based on the CODATA recommended values.

Overview

This library aims to provide accurate, up-to-date physical constants for scientific and engineering calculations in Zig, following the latest CODATA recommendations.

Features

  • Standard physical constants (e.g., Planck constant, speed of light, elementary charge)
  • Easy-to-use Zig API
  • Values sourced from CODATA and NIST

Installation

Fetch this repository :

$ zig fetch --save git+https://github.com/astrozig/codata.zig

Add it to your build.zig :

const std = @import("std");

pub fn build(b: *std.Build) void {
    // -- snip --

+   const codata_dep = b.dependency("codata_zig", .{
+       .target = target,
+       .optimize = optimize,
+   });

    // Where `exe` represents your executable/library to link to
+   exe.root_module.addImport("codata", codata_dep.module("codata"));

    // -- snip --
}

Usage

const codata = @import("codata");

pub fn main() !void {
    const c = codata.speed_of_light_in_vacuum; // Example
    // Use constants in calculations
}

Updating constants

Generate new constants from src file:

zig run src/gen.zig -- data/CODATA_2022_adjustment.txt

About

Zig library providing physical constants and reference data based on the CODATA recommended values.

Topics

astronomyphysical-quantitiesscienceunits-of-measurezig

Resources

Readme
MIT license
Activity
Custom properties

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.